package com.eight.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author 郭坤
 * @since 2023-02-24
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tbOrder", description="订单实体类")
@TableName(value = "tb_order")
@Accessors(chain = true)
public class TbOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单ID")
    @TableId(value = "id", type = IdType.AUTO)
    @TableField(value = "id")
    private Integer id;

    @ApiModelProperty(value = "客户ID")
    @TableField(value = "client_id")
    private Integer clientId;

    @ApiModelProperty(value = "客户姓名")
    @TableField(exist = false)
    private String username;

    @ApiModelProperty(value = "车辆ID")
    @TableField(value = "car_id")
    private Integer carId;

    @ApiModelProperty(value = "开始时间")
    @TableField(value = "start_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "结束时间")
    @TableField(value = "end_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "租出门店")
    @TableField(value = "brrow_shop")
    private Integer brrowShop;

    @ApiModelProperty(value = "归还门店")
    @TableField(value = "return_shop")
    private Integer returnShop;

    @ApiModelProperty(value = "总金额")
    @TableField(value = "total_price")
    private BigDecimal totalPrice;

    @ApiModelProperty(value = "预付金额")
    @TableField(value = "preparid_amount")
    private BigDecimal preparidAmount;

    @ApiModelProperty(value = "订单状态（输入Entered1，提交Booked2，预约Reserved3，使用中Inuse4，交还Returned5，取消Cancelled6）")
    @TableField(value = "state")
    private Integer state;

    @ApiModelProperty(value = "是否送车上门")
    @TableField(value = "IsGetCarAtHome")
    private String IsGetCarAtHome;

    @ApiModelProperty(value = "上门地址ID")
    @TableField(value = "GetCarLocation")
    private String GetCarLocation;

    @ApiModelProperty(value = "是否上门还车")
    @TableField(value = "IsReturnCarAtHome")
    private String IsReturnCarAtHome;

    @ApiModelProperty(value = "上门地址ID")
    @TableField(value = "ReturnCarLocation")
    private String ReturnCarLocation;

    @TableField(value = "addtime")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime addtime;

    @TableField("orderNo")
    private String orderNo;
    @TableField(exist = false)
    private TbUser tbUser;
    @TableField(exist = false)
    private TbCar tbCar;



}
